/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.qinyeit.serviceapp.entity.enums.PropType;
import com.qinyeit.serviceapp.entity.enums.State;
import lombok.Builder;
import lombok.experimental.Tolerate;

import javax.persistence.*;

/**
 * ClassName: Branch <br/>
 * Function: 分店 <br/>
 * date: 2018-11-21 15:03:05 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="branchs")
public class Branch extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 名称 
    @Column(name="name", length = 300)
	private String name = null;

	// 区域id
    @Column(name="district_id")
	private Long districtId = null;

	// 行业 
    @Column(name="industry", length = 300)
	private String industry = null;

	// 属性 
    @Column(name="prop_type", length = 300)
	@Enumerated(EnumType.STRING)
	private PropType propType = PropType.DIRECT;

	// 权限模板  角色id
    @Column(name="template_id")
	private Long templateId = null;

	// 手机号 
    @Column(name="phone", length = 300)
	private String phone = null;

	// 联系电话 
    @Column(name="telephone", length = 300)
	private String telephone = null;

	// 地理位置 json串 {province:'陕西省',city:'西安市',county:'未央区'}
    @Column(name="location", length = 300)
	private String location = null;
//    JSONPath.eval(JSON.parse(location, "county.id"))

	// 详细地址 
    @Column(name="address", length = 300)
	private String address = null;

	// 注册码 
    @Column(name="reg_code", length = 300)
	private String regCode = null;

	// 用户名 
    @Column(name="username", length = 300)
	private String username = null;

	// 状态 
    @Column(name="state", length = 300)
	@Enumerated(EnumType.STRING)
	private State state = State.NORMAL;


	// 操作人
	@Column(name="operator_name")
	private String operatorName = null;

	// 分店商户id
	@Column(name="merchant_id")
	private Long merchantId = null;


	// 分店菜品库id
	@Column(name="dishes_store_id")
	private Long dishesStoreId = null;

	//分店是否下发过库存数据
	@Column(name="is_released")
	private Boolean released = false;


	// 联系人
	@Column(name="linker", length = 300)
	private String linker = null;


	// 密码
	@Transient
	private String password = null;
	// 密码
	@Transient
	private String passwordConfirm = null;

	// 区域名
	@Transient
	private String districtName = null;
	// 模板名
	@Transient
	private String templateName = null;
	// 是否是门店
	@Transient
	private Boolean iBranch = null;


	@Tolerate
	public Branch() {
		
	}
    @Tolerate
	public Branch(Long id){
    	super.setId(id);
    }

	public Long getMerchantId() {
		return merchantId;
	}

	public void setMerchantId(Long merchantId) {
		this.merchantId = merchantId;
	}

	/**
	 * 获取名称
	 */
	public String getName() {
		return this.name;
	}

    /**
     * 设置名称
     */
	public Branch setName(String name) {
		this.name = name;
		return this;
	}

	/**
	 * 获取所选权限串json
	 */
	public Long getDistrictId() {
		return this.districtId;
	}

    /**
     * 设置所选权限串json
     */
	public Branch setDistrictId(Long districtId) {
		this.districtId = districtId;
		return this;
	}

	/**
	 * 获取行业
	 */
	public String getIndustry() {
		return this.industry;
	}

    /**
     * 设置行业
     */
	public Branch setIndustry(String industry) {
		this.industry = industry;
		return this;
	}

	public PropType getPropType() {
		return propType;
	}

	public void setPropType(PropType propType) {
		this.propType = propType;
	}

	/**
	 * 获取权限模板
	 */
	public Long getTemplateId() {
		return this.templateId;
	}

    /**
     * 设置权限模板
     */
	public Branch setTemplateId(Long templateId) {
		this.templateId = templateId;
		return this;
	}

	/**
	 * 获取手机号
	 */
	public String getPhone() {
		return this.phone;
	}

    /**
     * 设置手机号
     */
	public Branch setPhone(String phone) {
		this.phone = phone;
		return this;
	}

	/**
	 * 获取联系电话
	 */
	public String getTelephone() {
		return this.telephone;
	}

    /**
     * 设置联系电话
     */
	public Branch setTelephone(String telephone) {
		this.telephone = telephone;
		return this;
	}

	/**
	 * 获取地理位置
	 */
	public String getLocation() {
		return this.location;
	}

    /**
     * 设置地理位置
     */
	public Branch setLocation(String location) {
		this.location = location;
		return this;
	}

	/**
	 * 获取详细地址
	 */
	public String getAddress() {
		return this.address;
	}

    /**
     * 设置详细地址
     */
	public Branch setAddress(String address) {
		this.address = address;
		return this;
	}

	/**
	 * 获取注册码
	 */
	public String getRegCode() {
		return this.regCode;
	}

    /**
     * 设置注册码
     */
	public Branch setRegCode(String regCode) {
		this.regCode = regCode;
		return this;
	}

	/**
	 * 获取用户名
	 */
	public String getUsername() {
		return this.username;
	}

    /**
     * 设置用户名
     */
	public Branch setUsername(String username) {
		this.username = username;
		return this;
	}

	/**
	 * 获取密码
	 */
	public String getPassword() {
		return this.password;
	}

    /**
     * 设置密码
     */
	public Branch setPassword(String password) {
		this.password = password;
		return this;
	}

	public State getState() {
		return state;
	}

	public void setState(State state) {
		this.state = state;
	}

	public String getPasswordConfirm() {
		return passwordConfirm;
	}

	public void setPasswordConfirm(String passwordConfirm) {
		this.passwordConfirm = passwordConfirm;
	}

	public String getOperatorName() {
		return operatorName;
	}

	public void setOperatorName(String operatorName) {
		this.operatorName = operatorName;
	}

	public String getDistrictName() {
		return districtName;
	}

	public void setDistrictName(String districtName) {
		this.districtName = districtName;
	}

	public String getTemplateName() {
		return templateName;
	}

	public void setTemplateName(String templateName) {
		this.templateName = templateName;
	}

	public Boolean getiBranch() {
		return iBranch;
	}

	public void setiBranch(Boolean iBranch) {
		this.iBranch = iBranch;
	}

	public Long getDishesStoreId() {
		return dishesStoreId;
	}

	public void setDishesStoreId(Long dishesStoreId) {
		this.dishesStoreId = dishesStoreId;
	}

	public Boolean getReleased() {
		return released;
	}

	public void setReleased(Boolean released) {
		this.released = released;
	}

	public String getLinker() {
		return linker;
	}

	public void setLinker(String linker) {
		this.linker = linker;
	}
}
